/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package maps;

/**
 *
 * @author menderleit
 */
public class DungeonOptions {

    public static final int LAYOUT_SCATTERED = 0;
    public static final int LAYOUT_SPARSE = 1;
    public static final int LAYOUT_DENSE = 2;
    public static final int LAYOUT_SYMMETRIC = 3;
    public static final int BEND_RANDOM = 0;
    public static final int BEND_MORE = 1;
    public static final int BEND_NORMAL = 2;
    public static final int BEND_LESS = 3;
    public static final int BEND_STRAIGHT = 4;
    private long seed;
    private int roomMin;
    private int roomMax;
    private int layout;
    private int corridorBend;

    public DungeonOptions(int roomMin, int roomMax, int layout, int corridorBend) {
        seed = System.nanoTime();
        this.roomMin = roomMin;
        this.roomMax = roomMax;
        this.layout = layout;
        switch (corridorBend) {
            case BEND_RANDOM:
                this.corridorBend = 5;
                break;
            case BEND_MORE:
                this.corridorBend = 25;
                break;
            case BEND_NORMAL:
                this.corridorBend = 50;
                break;
            case BEND_LESS:
                this.corridorBend = 75;
                break;
            case BEND_STRAIGHT:
                this.corridorBend = 95;
                break;
            default:
                this.corridorBend = 50;
                break;
        }
    }

    public void setSeed(long seed) {
        this.seed = seed;
    }

    public long getSeed() {
        return seed;
    }

    public void setRoomDimensions(int min, int max) {
        roomMin = min;
        roomMax = max;
        if (roomMin % 2 == 0) {
            roomMin--;
        }
        if (roomMax % 2 == 0) {
            roomMax--;
        }
    }

    public int getRoomMin() {
        return roomMin;
    }

    public int getRoomMax() {
        return roomMax;
    }

    public void setLayout(int layout) {
        this.layout = layout;
    }
    
    public int getLayout() {
        return layout;
    }
    
    public void setCorridorBend(int corridorBend) {
        switch (corridorBend) {
            case BEND_RANDOM:
                this.corridorBend = 5;
                break;
            case BEND_MORE:
                this.corridorBend = 25;
                break;
            case BEND_NORMAL:
                this.corridorBend = 50;
                break;
            case BEND_LESS:
                this.corridorBend = 75;
                break;
            case BEND_STRAIGHT:
                this.corridorBend = 95;
                break;
            default:
                this.corridorBend = 50;
                break;
        }
    }

    public int getCorridorBend() {
        return corridorBend;
    }
}
